using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using FutureOpen.Web.Pages;
using FutureOpen.Core.func.sql;
using FutureOpen.Core.func.util;

public partial class controls_OverviewGroups : System.Web.UI.UserControl
{
    private int cid;
    private PageBase pbase;
    protected void Page_Load(object sender, EventArgs e)
    {
        pbase = (PageBase)this.Page;
        pbase.PageInit();

        cid = pbase.catid;
        if (!Page.IsPostBack)
        {
            LoadGroups();
        }
     
    }
    public void LoadGroups()
    {
        if (cid < 0)
        {
            cid = 0;
        }
        CatItem.Init();
        CatItem item = CatItem.index[cid];


        StringBuilder sb = new StringBuilder();
        foreach(CatItem subitem in item.subitems.Values)
        {
            sb.Append("<li>");
             string url = CatItem.GetLink(subitem);
            sb.Append("<span>"  + url + "</span><br/>");
			sb.Append("<span>");
            
            foreach (CatItem subsubitem in subitem.subitems.Values)
            {
                url = CatItem.GetLink(subitem);
                sb.Append(url + "&nbsp;"); 
            }
            sb.Append("</span>");
            sb.Append("</li>");

				
        }
        this.ltContent.Text = sb.ToString();

                        
    }
}

